<template>
  <div style="margin-left: 50px; margin-top: 50px">
    <h1>单张图片</h1>
    <ele-upload-image
      v-model="image1"
      :file-size="0.1"
      :is-show-tip="false"
      :lazy="true"
      :response-fn="handleResponse"
      :action="httpFileUploadUrl"
      title="单张图片"
    />
    <h1>多张图片</h1>
    <ele-upload-image
      v-model="images"
      :file-size="5"
      :response-fn="handleResponse"
      :action="httpFileUploadUrl"
      multiple
    />
    <!-- <h1>拖拽</h1> -->
    <!-- <ele-upload-image
      v-model="image2"
      :response-fn="handleResponse"
      action="httpFileUploadUrl"
      drag
    />
    <h1>裁剪</h1>
    <ele-upload-image
      v-model="image3"
      :response-fn="handleResponse"
      :size="100"
      :action="httpFileUploadUrl"
      crop
    /> -->
  </div>
</template>

<script>
import EleUploadImage from '@/components/upload/EleUploadImage'
import defaultSettings from '@/settings'
export default {
  name: 'App',
  components: {
    EleUploadImage
  },
  data() {
    return {
      image1: '',
      image2: '',
      image3: '',
      images: [],
      httpFileUploadUrl: defaultSettings.fileUploadUrl
    }
  },
  methods: {
    handleResponse(response, file, fileList) {
      return file.url
    }
  }
}
</script>
